const BaseFrameSet = () => import('__LAYOUTS__/base_frame_set/BaseFrameSet.vue')
// import BaseFrameSet from '__LAYOUTS__/base_frame_set/BaseFrameSet.vue'
const ArticleDisplay = () => import('__VIEWS__/article/ArticleDisplay.vue')
// import ArticleDisplay from '__VIEWS__/article/ArticleDisplay.vue'

// 有router-view 的组件都不能用 functional 函数式
const ArticleFrameSetComponent = {
  name: 'ArticleFrameSetComponent',
  render(createElement, context) {
    return  createElement(BaseFrameSet, {class: 'article'})
  }
}

export default {
  path: '/article',
  name: 'Article',
  component: ArticleFrameSetComponent,
  redirect: {name: 'ArticleDisplay', params: {articleId: 'not_found'}},
  meta: { title: '文章' },
  children: [{
    path: ':articleId',
    name: 'ArticleDisplay',
    meta: { title: '展示' },
    props: (route) => {
      return {id: route.params.articleId, articleId: route.params.articleId}
    },
    component: ArticleDisplay
  }]
}